package com.mz.ieann.dokit.sdk.interceptor

import android.util.Log
import com.mz.ieann.dokit.sdk.SDKConstant
import okhttp3.logging.HttpLoggingInterceptor

/**
 * <p>------------------------------------------------------
 * <p> Copyright (C) 2021 zhangmz, All rights reserved.
 * <p> If there is technical discussion, you can contact zhangmz90@foxmail.com
 * <p>------------------------------------------------------
 * <p> 日志拦截器
 * <p>
 *
 * @author Created by Administrator
 * @date on 2021 2021/11/15 19:33
 */
class LogInterceptor : HttpLoggingInterceptor.Logger {

    override fun log(message: String) {

        // 日志过滤
        if (message.isEmpty() ||
            message.contains("Content-") ||
            message.contains("content-") ||
            message.contains("charset:") ||
            message.contains("hunterid:") ||
            message.contains("server:") ||
            message.contains("vary:") ||
            message.contains("date: Wed") ||
            message.contains("x-xss-protection:") ||
            message.contains("-->")) {
            return
        }
        Log.v(SDKConstant.TAG, "message: $message")
    }

}